cmake_minimum_required(VERSION 3.10)
project(OpenCV_Image_Viewer)

# 查找OpenCV（必须与你编译的版本匹配）
find_package(OpenCV 4.2 REQUIRED)

# 显示配置信息
message(STATUS "OpenCV library status:")
message(STATUS "    Version: ${OpenCV_VERSION}")
message(STATUS "    Libraries: ${OpenCV_LIBS}")
message(STATUS "    Include path: ${OpenCV_INCLUDE_DIRS}")

# 生成可执行文件
add_executable(display_image display_image.cpp)

# 链接OpenCV库
target_link_libraries(display_image ${OpenCV_LIBS})

